package org.wesc.boot.dao.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author Wesley
 * @since 2019-12-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_login_log")
public class LoginLog extends Model<LoginLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 用户登录记录ID
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 登录时间
     */
    private LocalDateTime loginTime;

    /**
     * 登录设备
     */
    private String device;

    /**
     * 登录地点
     */
    private String location;

    /**
     * IP地址
     */
    private String ip;


    public static final String ID = "ID";

    public static final String USER_ID = "USER_ID";

    public static final String USER_NAME = "USER_NAME";

    public static final String LOGIN_TIME = "LOGIN_TIME";

    public static final String DEVICE = "DEVICE";

    public static final String LOCATION = "LOCATION";

    public static final String IP = "IP";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
